A temporary random jitter, power pixels at its peak, linearly decaying to 0 over frames. power<=0 or frames<=0 stops any shake in progress at once.
Works differently on Game Boy - The camera shake on the Game Boy moves the picture to and fro by the power, falling to nothing, instead of random jolts.
Works differently on Game Boy Color - A camera shake shakes the picture as on the Game Boy Advance, but the picture never moves past the edge of the room, so a shake at an edge is smaller.
On other consoles this differs: see Side by side and How the consoles differ.
camera_shake(power, frames)| Name | Type |
|---|---|
power | real |
frames | int |
Nothing.
A temporary random jitter on top of wherever the camera already is - power pixels at its peak, decaying to nothing over frames. Passing power or frames as 0 or less stops any shake already in progress at once. The jitter is added only at the instant the camera's position is actually shown and precisely removed before the next frame's own easing math runs, so a shake can never itself become part of what a following camera eases toward - it reads as a jolt on top of normal camera motion, never a lasting displacement.
camera_shake(4, 20);A short, sharp jolt - up to 4 pixels off in a random direction, fading out over the next 20 frames (about a third of a second) - the usual weight for a hit landing or a nearby explosion.




The two captures above use a stronger shake than the example (camera_shake(10, 20)) so the difference reads clearly at this size - the mechanism is identical, just easier to see at a glance than a realistic 4-pixel jolt would be.
Added on top of the eased/set position only at the moment it is shown, and precisely subtracted back out before the next frame’s lag computation - shaking never itself becomes part of what the ease/lag targets, and never desyncs a moving sprite’s own pixel truncation the way easing the raw position would (the rule "never ease the camera’s raw position").